package main

import "fmt"

/**
 * @Description
 * @Author huran
 * @Date
 * @Param
 * @return
 **/

type Person struct {
	Name string
	Age  int
}

// 接收器 2中形态
func (p *Person) print() {
	fmt.Println(p)
}
func (p Person) print2() {
	fmt.Println(p)
}
func swap(a, b *int) {
	*a, *b = *b, *a
}
func main() {

	//匿名结构体
	//address := struct {
	//	city string
	//	name string
	//}{city: "A", name: "b"}
	//fmt.Println(address)
	//var p = new(Person)
	//var p *Person //必须初始化
	var p Person
	pp := &p
	println(pp.Name)
	a, b := 1, 2
	swap(&a, &b)
	fmt.Println(a, b)
}
